﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Data;
using Entity;

namespace Business
{
    public class News_Bussiness
    {
        public bool Add_News(News_Entity news)
        {
            News_Data add_news = new News_Data();
            return add_news.Insert_news(news);
        }
        public DataTable Load()
        {
            News_Data news = new News_Data();
            try
            {
                return news.Load();
            }
            catch
            {
                throw;
            }
            finally
            {
                news = null;
            }
        }
        public int Update(int newsID, string topicname, string topic)
        {
            News_Data n = new News_Data();
            try
            {
                return n.Update_news(newsID, topicname, topic);
            }
            catch
            {
                throw;
            }
            finally
            {
                n = null;
            }
        }
        public int Delete(int newsID)
        {
            News_Data pDAL = new News_Data();
            try
            {
                return pDAL.Delete(newsID);
            }
            catch
            {
                throw;
            }
            finally
            {
                pDAL = null;
            }
        }

        
    }
}
